home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / CIncludes / Graf3D.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-29  |  2.2 KB  |  105 lines  |  [TEXT/MPS ]

  1.  
  2. /************************************************************
  3.  
  4. Created: Friday, September 13, 1991 at 12:49 PM
  5.  Graf3D.h
  6.  C Interface to the Macintosh Libraries
  7.  
  8.  
  9.   Copyright Apple Computer, Inc. 1985-1991
  10.   All rights reserved
  11.  
  12. ************************************************************/
  13.  
  14.  
  15. #ifndef __GRAF3D__
  16. #define __GRAF3D__
  17.  
  18. #ifndef __QUICKDRAW__
  19. #include <Quickdraw.h>
  20. #endif
  21.  
  22.  
  23. enum {
  24.  
  25.  radConst = 3754936
  26. };
  27.  
  28. typedef Fixed XfMatrix[4][4];
  29.  
  30. struct Point3D {
  31.  Fixed x;
  32.  Fixed y;
  33.  Fixed z;
  34. };
  35.  
  36. typedef struct Point3D Point3D;
  37.  
  38. struct Point2D {
  39.  Fixed x;
  40.  Fixed y;
  41. };
  42.  
  43. typedef struct Point2D Point2D;
  44.  
  45. struct Port3D {
  46.  GrafPtr grPort;
  47.  Rect viewRect;
  48.  Fixed xLeft;
  49.  Fixed yTop;
  50.  Fixed xRight;
  51.  Fixed yBottom;
  52.  Point3D pen;
  53.  Point3D penPrime;
  54.  Point3D eye;
  55.  Fixed hSize;
  56.  Fixed vSize;
  57.  Fixed hCenter;
  58.  Fixed vCenter;
  59.  Fixed xCotan;
  60.  Fixed yCotan;
  61.  char filler;
  62.  char ident;
  63.  XfMatrix xForm;
  64. };
  65.  
  66. typedef struct Port3D Port3D;
  67. typedef Port3D *Port3DPtr, **Port3DHandle;
  68.  
  69.  
  70. #ifdef __cplusplus
  71. extern "C" {
  72. #endif
  73. pascal void InitGrf3d(Port3DHandle port); 
  74. pascal void Open3DPort(Port3DPtr port); 
  75. pascal void SetPort3D(Port3DPtr port); 
  76. pascal void GetPort3D(Port3DPtr *port); 
  77. pascal void MoveTo2D(Fixed x,Fixed y); 
  78. pascal void MoveTo3D(Fixed x,Fixed y,Fixed z); 
  79. pascal void LineTo2D(Fixed x,Fixed y); 
  80. pascal void Move2D(Fixed dx,Fixed dy); 
  81. pascal void Move3D(Fixed dx,Fixed dy,Fixed dz); 
  82. pascal void Line2D(Fixed dx,Fixed dy); 
  83. pascal void Line3D(Fixed dx,Fixed dy,Fixed dz); 
  84. pascal void ViewPort(const Rect *r); 
  85. pascal void LookAt(Fixed left,Fixed top,Fixed right,Fixed bottom); 
  86. pascal void ViewAngle(Fixed angle); 
  87. pascal void Identity(void); 
  88. pascal void Scale(Fixed xFactor,Fixed yFactor,Fixed zFactor); 
  89. pascal void Translate(Fixed dx,Fixed dy,Fixed dz); 
  90. pascal void Pitch(Fixed xAngle); 
  91. pascal void Yaw(Fixed yAngle); 
  92. pascal void Roll(Fixed zAngle); 
  93. pascal void Skew(Fixed zAngle); 
  94. pascal void Transform(const Point3D *src,Point3D *dst); 
  95. pascal short Clip3D(const Point3D *src1,const Point3D *src2,Point *dst1,
  96.  Point *dst2); 
  97. pascal void SetPt3D(Point3D *pt3D,Fixed x,Fixed y,Fixed z); 
  98. pascal void SetPt2D(Point2D *pt2D,Fixed x,Fixed y); 
  99. pascal void LineTo3D(Fixed x,Fixed y,Fixed z); 
  100. #ifdef __cplusplus
  101. }
  102. #endif
  103.  
  104. #endif
  105.